Skip to content

Update dependency boundwize/structarmed to ^0.21.0 - #580

Merged
alexmerlin merged 1 commit into
7.0from
renovate/boundwize-structarmed-0.x
Nov 7, 2026
Merged

alexmerlin merged 1 commit into
7.0from
renovate/boundwize-structarmed-0.x

Conversation

@renovate

@renovate renovate Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
boundwize/structarmed ^0.20.0 → ^0.21.0 age confidence

Release Notes

boundwize/structarmed

v0.21.4: Released: StructArmed 0.21.4

Compare Source

ci build PHPStan

What's Changed

  • fix: Match language constructs case-insensitively in usesLanguageConstruct() by @​samsonasik in #​543

Full Changelog: boundwize/structarmed@0.21.3...0.21.4

v0.21.3: Released: StructArmed 0.21.3

Compare Source

ci build PHPStan

What's Changed

  • [dx] Mention promoted members in ApiMayNotExposeInternalRule violation message by @​samsonasik in #​542

Full Changelog: boundwize/structarmed@0.21.2...0.21.3

v0.21.2: Released: StructArmed 0.21.2

Compare Source

ci build PHPStan

What's Changed

Full Changelog: boundwize/structarmed@0.21.1...0.21.2

v0.21.1: Released: StructArmed 0.21.1

Compare Source

ci build PHPStan

What's Changed

  • [dx] Add isPromoted to ClassSignature to tell promoted properties from declared ones by @​samsonasik in #​540

Full Changelog: boundwize/structarmed@0.21.0...0.21.1

v0.21.0: Released: StructArmed 0.21.0

Compare Source

ci build PHPStan

StructArmed 0.21.0 introduces a new Enum preset, stronger API stability checks, signature type analysis for custom rules, and improved enum formatting support.

This release introduces:

  • the new Preset::ENUM() for validating string-backed enum case values;
  • ApiMayNotExposeInternalRule for preventing public APIs from exposing internal types;
  • ClassSignature and SignatureTypesAwareRuleInterface for analyzing member signature types;
  • the new fixable EnumCaseMustBeOnOwnLineRule in the PER preset;
  • improved backed enum value resolution and analysis cache support.

New Enum Preset

StructArmed introduces a new preset for validating string-backed enum case values:

Preset::ENUM()

The preset includes two new rules:

  • EnumCaseValueMustNotBeEmptyRule — prevents empty string-backed enum values.
  • EnumCaseValueMustNotHaveSurroundingWhitespaceRule — prevents leading or trailing whitespace in string-backed enum values.

For example:

enum Status: string
{
    case Pending = '';
    case Active = ' active ';
    case Completed = 'completed';
}

The first two cases produce violations, while Completed is valid.

The rules check statically resolved string-backed values. Pure enums and integer-backed enums are unaffected.

These rules do not support --fix, as changing backing values could break existing APIs or persisted data.

Enable the preset with:

use Boundwize\StructArmed\Preset\Preset;

// In your architecture configuration:
->withPreset(Preset::ENUM())

Or initialize a new configuration:

vendor/bin/structarmed init --preset=enum

API Stability Improvements

The Stability preset now includes ApiMayNotExposeInternalRule, preventing @api declarations from exposing @internal types through public or protected signatures.

For example:

/** @internal */
class InternalService
{
}

/** @api */
class PublicService
{
    public function getService(): InternalService
    {
        return new InternalService();
    }
}

The rule reports an architecture violation because the public method exposes an internal implementation.

The rule checks:

  • public and protected method parameter types;
  • public and protected method return types;
  • public and protected property types;
  • constructor-promoted parameters that expose internal types.

Private implementation details remain unrestricted, except when exposed through a public or protected constructor parameter.

Only types within the scanned project are checked, since external declarations may not have available PHPDoc information.

New Signature Type Analysis

StructArmed introduces ClassSignature and SignatureTypesAwareRuleInterface for analyzing types referenced in class-like member signatures.

Each ClassSignature provides:

  • type — fully qualified referenced type;
  • name — originating property, parameter, or method;
  • kind — property, parameter, or method;
  • visibility — public, protected, or private;
  • line — source line.

Custom rules can implement SignatureTypesAwareRuleInterface to access signature information through $classNode->signatures.

Custom Rule Example

For example, prevent public repository methods from returning Doctrine's QueryBuilder:

<?php

declare(strict_types=1);

namespace App\Architecture\Rules;

use Boundwize\StructArmed\Analyser\ClassNode;
use Boundwize\StructArmed\Analyser\ClassSignature;
use Boundwize\StructArmed\Rule\RuleViolation;
use Boundwize\StructArmed\Rule\SignatureTypesAwareRuleInterface;
use Doctrine\ORM\QueryBuilder;

final readonly class MayNotReturnQueryBuilderRule implements SignatureTypesAwareRuleInterface
{
    public function appliesTo(ClassNode $classNode): bool
    {
        return $classNode->nameEndsWith('Repository');
    }

    public function evaluate(ClassNode $classNode): ?RuleViolation
    {
        foreach ($classNode->signatures as $signature) {
            if (
                $signature->kind !== ClassSignature::METHOD
                || $signature->visibility !== 'public'
                || $signature->type !== QueryBuilder::class
            ) {
                continue;
            }

            return new RuleViolation(
                message: 'Public repository methods must not return QueryBuilder',
                file: $classNode->file,
                line: $signature->line,
                className: $classNode->className,
                layer: $classNode->layer,
            );
        }

        return null;
    }
}

With this rule, the following method produces a violation:

final class UserRepository
{
    public function createQuery(): QueryBuilder
    {
        // ...
    }
}

This allows repositories to use QueryBuilder internally without exposing it through their public APIs.

Signature collection is enabled only when an active rule implements SignatureTypesAwareRuleInterface, avoiding unnecessary analysis overhead and cache storage.

The collector supports nullable, union, intersection, and DNF types, including constructor-promoted properties.

PER Coding Style Improvements

The PER preset now includes EnumCaseMustBeOnOwnLineRule, requiring each enum case to be declared on its own line.

For example:

enum Status
{
    case Pending; case Active;
}

The rule supports automatic fixing:

vendor/bin/structarmed analyse --fix

Result:

enum Status
{
    case Pending;
    case Active;
}

The fixer preserves associated comments when moving enum cases, including comments on shared lines.

Bug Fixes and Internal Improvements

  • Improve backed enum value resolution for local constants, including forward references.
  • Add EnumCaseNode::sharesLine for detecting enum cases that share a line with another member or enum brace.
  • Improve comment preservation when automatically formatting enum cases.
  • Extend analysis caching to support optional signature collection.
  • Update documentation and test coverage.

What's Changed

  • Add API signature exposure analysis and ClassSignature support in #​524 and #​526.
  • Improve backed enum value resolution in #​529.
  • Add fixable enum case formatting to the PER preset in #​530.
  • Introduce the new Enum preset and validation rules in #​536 and #​537.
  • Preserve comments when moving enum cases onto separate lines in #​538.
  • Prepare the 0.21.0 release in #​525.

Full Changelog: boundwize/structarmed@0.20.5...0.21.0


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.64%. Comparing base (2fb00a8) to head (707481f).

Additional details and impacted files
@@            Coverage Diff            @@
##                7.0     #580   +/-   ##
=========================================
  Coverage     64.64%   64.64%           
  Complexity     1003     1003           
=========================================
  Files           181      181           
  Lines          3437     3437           
=========================================
  Hits           2222     2222           
  Misses         1215     1215           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Qodana for PHP

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 110 dependencies

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
brick/math 1.0.0 MIT
brick/varexporter 0.7.0 MIT
defuse/php-encryption v2.4.0 MIT
doctrine/collections 2.6.0 MIT
doctrine/common 3.5.0 MIT
doctrine/data-fixtures 2.2.1 MIT
doctrine/dbal 4.5.0 MIT
doctrine/deprecations 1.1.6 MIT
doctrine/event-manager 2.1.1 MIT
doctrine/inflector 2.1.1 MIT
doctrine/instantiator 2.0.0 MIT
doctrine/lexer 3.0.3 MIT
doctrine/migrations 3.9.8 MIT
doctrine/orm 3.7.6 MIT
doctrine/persistence 4.2.1 MIT
dotkernel/dot-cache 4.4.0 MIT
dotkernel/dot-cli 3.11.1 MIT
dotkernel/dot-data-fixtures 1.5.0 MIT
dotkernel/dot-dependency-injection 1.4.1 MIT
dotkernel/dot-errorhandler 4.0.2 MIT
dotkernel/dot-event 4.4.0 MIT
dotkernel/dot-log 4.0.6 MIT
dotkernel/dot-mail 5.4.3 MIT
dotkernel/dot-response-header 3.6.0 MIT
dotkernel/dot-router 1.1.0 MIT
egulias/email-validator 4.0.4 MIT
fig/http-message-util 1.1.5 MIT
laminas/laminas-authentication 2.19.0 BSD-3-Clause
laminas/laminas-cli 1.15.0 BSD-3-Clause
laminas/laminas-component-installer 3.8.0 BSD-3-Clause
laminas/laminas-config-aggregator 1.20.0 BSD-3-Clause
laminas/laminas-diactoros 3.10.0 BSD-3-Clause
laminas/laminas-escaper 2.18.0 BSD-3-Clause
laminas/laminas-eventmanager 3.15.0 BSD-3-Clause
laminas/laminas-filter 2.42.0 BSD-3-Clause
laminas/laminas-httphandlerrunner 2.14.0 BSD-3-Clause
laminas/laminas-hydrator 4.19.0 BSD-3-Clause
laminas/laminas-inputfilter 2.35.0 BSD-3-Clause
laminas/laminas-permissions-acl 2.18.0 BSD-3-Clause
laminas/laminas-permissions-rbac 3.8.0 BSD-3-Clause
laminas/laminas-servicemanager 3.24.0 BSD-3-Clause
laminas/laminas-stdlib 3.21.0 BSD-3-Clause
laminas/laminas-stratigility 4.3.1 BSD-3-Clause
laminas/laminas-validator 2.65.0 BSD-3-Clause
lcobucci/jwt 5.6.1 BSD-3-Clause
league/event 3.0.3 MIT
league/oauth2-server 9.4.1 MIT
league/uri-interfaces 7.10.0 MIT
league/uri 7.10.0 MIT
mezzio/mezzio-authentication-oauth2 3.1.0 BSD-3-Clause
mezzio/mezzio-authentication 1.13.0 BSD-3-Clause
mezzio/mezzio-authorization-acl 1.13.0 BSD-3-Clause
mezzio/mezzio-authorization-rbac 1.10.0 BSD-3-Clause
mezzio/mezzio-authorization 1.11.0 BSD-3-Clause
mezzio/mezzio-cors 1.16.0 BSD-3-Clause
mezzio/mezzio-fastroute 3.14.0 BSD-3-Clause
mezzio/mezzio-hal 2.14.0 BSD-3-Clause
mezzio/mezzio-helpers 5.20.0 BSD-3-Clause
mezzio/mezzio-problem-details 1.19.0 BSD-3-Clause
mezzio/mezzio-router 3.20.0 BSD-3-Clause
mezzio/mezzio-template 3.0.0 BSD-3-Clause
mezzio/mezzio 3.28.1 BSD-3-Clause
nikic/fast-route 1.3.1 BSD-3-Clause
nikic/php-parser v5.9.0 BSD-3-Clause
paragonie/random_compat v9.99.100 MIT
phpstan/phpdoc-parser 2.4.1 MIT
psr/cache 3.0.0 MIT
psr/clock 1.0.0 MIT
psr/container 1.1.2 MIT
psr/event-dispatcher 1.0.0 MIT
psr/http-client 1.0.3 MIT
psr/http-factory 1.1.0 MIT
psr/http-message 2.0 MIT
psr/http-server-handler 1.0.2 MIT
psr/http-server-middleware 1.0.2 MIT
psr/link 1.1.1 MIT
psr/log 3.0.2 MIT
radebatz/type-info-extras 1.0.12 MIT
ramsey/collection 2.1.1 MIT
ramsey/uuid-doctrine 2.1.0 MIT
ramsey/uuid 4.9.4 MIT
roave/psr-container-doctrine 6.0.0 BSD-2-Clause
spatie/array-to-xml 3.4.4 MIT
symfony/cache-contracts v3.8.1 MIT
symfony/cache v7.4.23 MIT
symfony/console v7.4.23 MIT
symfony/deprecation-contracts v3.8.1 MIT
symfony/event-dispatcher-contracts v3.8.1 MIT
symfony/event-dispatcher v7.4.17 MIT
symfony/filesystem v7.4.23 MIT
symfony/finder v7.4.23 MIT
symfony/mailer v7.4.22 MIT
symfony/mime v7.4.22 MIT
symfony/polyfill-ctype v1.37.0 MIT
symfony/polyfill-intl-grapheme v1.43.3 MIT
symfony/polyfill-intl-idn v1.43.0 MIT
symfony/polyfill-intl-normalizer v1.43.0 MIT
symfony/polyfill-mbstring v1.43.3 MIT
symfony/polyfill-php84 v1.43.0 MIT
symfony/polyfill-php86 v1.43.0 MIT
symfony/service-contracts v3.8.1 MIT
symfony/stopwatch v7.4.8 MIT
symfony/string v7.4.22 MIT
symfony/type-info v7.4.23 MIT
symfony/var-exporter v7.4.22 MIT
symfony/yaml v7.4.23 MIT
webimpress/safe-writer 2.2.0 BSD-2-Clause
webmozart/assert 2.5.0 MIT
willdurand/negotiation 3.1.0 MIT
zircote/swagger-php 6.20.2 Apache-2.0
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@alexmerlin
alexmerlin merged commit fbd96b3 into 7.0 Nov 7, 2026
40 checks passed
@alexmerlin
alexmerlin deleted the renovate/boundwize-structarmed-0.x branch November 7, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant